package org.example.physics_engine;

/*计算包含机器ε近似值的类。*/
public class Epsilon {
    //双精度浮点运算机的ε近似值
    public static final double E = Epsilon.compute();

    //隐藏默认构造函数
    private Epsilon() {}

    //返回机器的最小精度近似值
    public static final double compute() {
        double e = 0.5;
        while (1.0 + e > 1.0) {
            e *= 0.5;
        }
        return e;
    }
}
